<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>


<c:choose>
	<c:when test="${fn:length(QueryAAFForm.obj) == 0}">
	<%-- 
		<div style="width:650px;padding-top:10px;padding-left:20px;font-size: 16px;color: red;font-weight: 600;letter-spacing: 4px;vertical-align: middle; ">
			<img src="${appPath }/resource/image/warning.png" />
			查無筆數，請重新查詢
		</div>
	--%>
		<div style="padding-top:5px;">
			<table style="width:800px;border: 1px solid #C0C0C0;">	
				<tr>
					<td>
						<div style="padding:20px;font-size: 16px;font-weight: 300;letter-spacing: 4px;">
							<img src="${appPath }/resource/image/1320894006_Problem.png" style="vertical-align:middle;"/>
							<span style="color: #3B5998;">查無筆數，請重新查詢</span>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</c:when>
	<c:otherwise>	
				
		<table style="width:800px;">	
			<tr>
				<td style="text-align: right">
					<span id="ChgRowPerPageLoadingImg" style="display:none;">
						<img src="${appPath }/resource/image/ajax-loader.gif" />
					</span>
					<select class="bar_1" style="width:50px;" onchange="chgRowPerPage(this.value);">
						<option value="10" <c:if test="${QueryAAFForm.rowsPerPage == 10 }">selected</c:if>>10</option>
						<option value="20" <c:if test="${QueryAAFForm.rowsPerPage == 20 }">selected</c:if>>20</option>
						<option value="50" <c:if test="${QueryAAFForm.rowsPerPage == 50 }">selected</c:if>>50</option>
						<option value="100" <c:if test="${QueryAAFForm.rowsPerPage == 100 }">selected</c:if>>100</option>
					</select>
				</td>
			</tr>
		</table>
	
	
		<table style="width:800px;border:1px solid #D2D9E7;">						
			<tr class="trHeader">
				<td style="width:05%;text-align: center;">&nbsp;</td>
				<td style="width:10%;text-align: center;font-weight: 600;font-size: 13px;">資料編號</td>
				<td style="width:50%;text-align: center;font-weight: 600;font-size: 13px;">原文標題</td>
				<td style="width:20%;text-align: center;font-weight: 600;font-size: 13px;">作者</td> 
				<td style="width:08%;text-align: center;font-weight: 600;font-size: 13px;">出版年</td> 
				<!-- <td style="width:10%;text-align: center;font-weight: 600;font-size: 13px;">狀態</td>   -->
				<td style="width:07%;text-align: center;font-weight: 600;font-size: 13px;">動作</td> 
			</tr>
			<c:forEach items="${QueryAAFForm.obj }" var="agricultureAndFood" varStatus="s">		
				<tr class="trContent">
					<td style="text-align: center;font-weight: 600">
						${QueryAAFForm.firstResult + s.count }
					</td> 
					<td style="text-align: center;letter-spacing: 2px;">
						<span  style="color: green;">${agricultureAndFood.rec_no }</span>
					</td> 
					<td style="padding-left:10px;">
						
						<span id="LIST_TITLE_O_${agricultureAndFood.seq_no }">
							${agricultureAndFood.title_o  == '' ? '&nbsp;' : agricultureAndFood.title_o}
						</span>
					</td> 
					<td style="padding-left:10px;">
						<span id="LIST_AUTHOR_${agricultureAndFood.seq_no }">
							${agricultureAndFood.author  == '' ? '&nbsp;' : agricultureAndFood.author}
						</span>
					</td> 
					<td style="text-align: center;">
						<span id="LIST_YEAR_${agricultureAndFood.seq_no }">
							<c:choose>
								<c:when test="${agricultureAndFood.year == 1}">
									不明
								</c:when>
								<c:otherwise>
									${agricultureAndFood.year}
								</c:otherwise>
							</c:choose>
						</span>
					</td>		
					<!--  	
					<td style="text-align: center;">
						<span id="LIST_FLOW_${agricultureAndFood.seq_no }">
							<c:if test="${agricultureAndFood.flow == '0'}" >
								<span style="color:red">暫存</span>
							</c:if>
							
							<c:if test="${agricultureAndFood.flow == '1'}" >
								<span style="color:blue">完成</span>
							</c:if>
						</span>
					</td> 
					-->
					<td style="text-align: center;">
						<a href="javascript:void(0);" onclick="view('${agricultureAndFood.seq_no }',3);" title="檢視">
							<img src="${appPath }/resource/image/1317493246_Preview.png" border="0"/>
						</a>
						<!--  
						&nbsp;&nbsp;&nbsp;
						<a href="javascript:void(0);" onclick="view('${agricultureAndFood.seq_no }',2);" title="編輯">
							<img src="${appPath }/resource/image/1317492589_file_edit.gif" border="0"/>
						</a>
						-->
					</td>
				</tr>
			</c:forEach>	
		</table>
		<div style="width:650px;padding-top:10px;">${QueryAAFForm.pageInfo}</div>
	</c:otherwise>
</c:choose>

<form:form method="post" modelAttribute="QueryAAFForm" id="QueryAAFForm2" >
<form:hidden path="nowPage" />
<form:hidden path="rowsPerPage" />
<form:hidden path="firstResult" />
<form:hidden path="totalPages" />
<form:hidden path="totalRows" />
<form:hidden path="query_type" />
<form:hidden path="doc_typeStr" />
<form:hidden path="languageStr" />
<form:hidden path="clazzStr" />
<form:hidden path="requery" />
<form:hidden path="title_o" />
<form:hidden path="author" />
<form:hidden path="abstract_o" />
<form:hidden path="keyword_o" />
<form:hidden path="plants_code" />
<form:hidden path="countries_code" />
<form:hidden path="flow" />
<form:hidden path="rec_no" />
<form:hidden path="qr_boolean" />
<form:hidden path="created_users" />
<form:checkbox path="literature" value="1" cssStyle="display:none;"/>
<form:checkbox path="literature" value="2" cssStyle="display:none;"/>
<form:checkbox path="literature" value="3" cssStyle="display:none;"/>
<form:checkbox path="literature" value="4" cssStyle="display:none;"/>

<c:forEach var="qr" items="${QueryAAFForm.qr }" >
	<input type="hidden" name="qr" value="${qr }"/>
</c:forEach>
</form:form>
<%-- 
<form:form method="post" modelAttribute="QueryAAFForm" id="QueryAAFForm2" >
nowpage:<form:input path="nowPage" /><br/>
rowsPerPage:<form:input path="rowsPerPage" /><br/>
firstResult:<form:input path="firstResult" /><br/>
totalPages:<form:input path="totalPages" /><br/>
totalRows:<form:input path="totalRows" /><br/>
query_type:<form:input path="query_type" /><br/>
doc_typeStr:<form:input path="doc_typeStr" /><br/>
languageStr:<form:input path="languageStr" /><br/>
clazzStr:<form:input path="clazzStr" /><br/>
requery:<form:input path="requery" /><br/>
title_o:<form:input path="title_o" /><br/>
author:<form:input path="author" /><br/>
abstract_o:<form:input path="abstract_o" /><br/>
keyword_o:<form:input path="keyword_o" /><br/>
plants_code:<form:input path="plants_code" /><br/>
countries_code:<form:input path="countries_code" /><br/>
flow:<form:input path="flow" />
</form:form>
--%>